﻿#region Copyright Info

// 
// Majesty of Omega - The next evolution of macro management space strategy
// 
// Copyright 2007-2009 André Claaßen
// 
// This file is protected by the terms and conditions of the
// Microsoft Community License (Ms-CL 1.1), a copy of which should
// have been distributed along with this software. If not,
// you may find the license information at the following URL:
// 
// http://www.microsoft.com/resources/sharedsource/licensingbasics/communitylicense.mspx

#endregion

#region

using Majesty_of_Omega.Model.Space;
using Majesty_of_Omega.Logic.Generator;
#if NUNIT
using Majesty_of_Omega.Model.Structures;
using NUnit.Framework;
using TestClass = NUnit.Framework.TestFixtureAttribute;
using TestMethod = NUnit.Framework.TestAttribute;
using TestInitialize = NUnit.Framework.SetUpAttribute;
using TestCleanup = NUnit.Framework.TearDownAttribute;
using ClassInitialize = NUnit.Framework.TestFixtureSetUpAttribute;
using ClassCleanup = NUnit.Framework.TestFixtureTearDownAttribute;
#elif MBUNIT
using MbUnit.Framework;
using TestClass = MbUnit.Framework.TestFixtureAttribute;
using TestMethod = MbUnit.Framework.TestAttribute;
using TestInitialize = MbUnit.Framework.SetUpAttribute;
using TestCleanup = MbUnit.Framework.TearDownAttribute;
using ClassInitialize = MbUnit.Framework.TestFixtureSetUpAttribute;
using ClassCleanup = MbUnit.Framework.TestFixtureTearDownAttribute;
#else
using Microsoft.VisualStudio.TestTools.UnitTesting;
#endif


#endregion

namespace Test.Majesty_of_Omega
{
    /// <summary>
    ///This is a test class for TestRegion and is intended
    ///to contain all TestRegion Unit Tests
    ///</summary>
    [TestClass]
    public class TestRegion
    {
 

        #region Additional test attributes

        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //

        #endregion

        /// <summary>
        ///A test for DeaList property of the Reagion. There must be at least one abstract DEA for the regional improvements
        ///</summary>
        [TestMethod]
        public void TestDeaList()
        {
            Region testRegion = TestDataGenerator.CreateTestRegion(RegionType.Broken);
            DEA dea = testRegion.DeaList[0];
            Assert.IsNotNull(dea, "There must be at least one DEA");
            Assert.AreEqual(DeaType.DeaRegion, dea.DeaType,
                            "The type of the first DEA must be DeaRegion. It is the abstracat DEA for the regional improvements");
            Assert.AreEqual(RegionType.Broken, testRegion.RegionType);
            Assert.IsNotNull(dea.DeaTypeInfoBlock);
        }
    }
}